package com.sghd.charge.module.payment.alipay;

import com.sghd.charge.module.model.ChannelType;
import com.sghd.charge.module.model.ChargeConstant;
import com.sghd.charge.module.order.entity.Goods;
import com.sghd.charge.module.payment.AbstractProcessor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.servlet.ServletRequest;

@Service
public class AlipayProcessor extends AbstractProcessor {
	public static final String OWNER_ORDER_ID = "out_trade_no";
	public static final String TRADE_STATUS = "trade_status";
	public static final String REFUND_STATUS = "refund_status";
	public static final String TOTAL_FEE = "total_fee";
	public static final String TRADE_NO = "trade_no";
	public static final String BUYER_ID = "buyer_id";
	public static final String BUYER_EMAIL = "buyer_email";

	@Value(ChargeConstant.ALIPAY_VERIFY_URL)
	private String verifyUrl;
	
	private String partner;
	
	private String privateKey;
	
	private String publicKey ;
	
	private String signType;
	
	private String inputCharset = "utf-8";
	
	private String email;
	
	private String notifyUrl;

	@Override
	public ChannelType getType() {
		return ChannelType.ALIPAY;
	}

	@Override
	public String getAddtion(Goods goods, long orderId, String ip) {
		//TODO 给客户端，封装调起支付宝所需的参数

        return null;
	}

	@Override
	public String notify(ServletRequest request) {
		//TODO 支付宝，支付成功异步回调处理


		return null;
	}

}
